const app = getApp()

Page({
  data: {
    //-----------模拟banner图-----------
    imgUrls: [
      'http://i2.tiimg.com/713775/65c1224e0be95a36.png',
      'http://i2.tiimg.com/713775/65c1224e0be95a36.png',
      'http://i2.tiimg.com/713775/65c1224e0be95a36.png',
      'http://i2.tiimg.com/713775/65c1224e0be95a36.png'
    ],
    circular: true,
    //是否显示画板指示点  
    indicatorDots: true,
    //选中点的颜色  
    //是否竖直  
    vertical: false,
    //是否自动切换  
    autoplay: true,
    //自动切换的间隔
    interval: 5000,
    //滑动动画时长毫秒  
    duration: 1000,
    //所有图片的高度  
    // imgheights: [],
    //图片宽度 
    imgwidth: 900,
    bg: '#C79C77',
    Height: ""   ,
    //默认  
    current: 0
  },

  imgHeight: function (e) {
    var winWid = wx.getSystemInfoSync().windowWidth; //获取当前屏幕的宽度
    var imgh = e.detail.height+15;//图片高度
    var imgw = e.detail.width;//图片宽度
    var swiperH = winWid * imgh / imgw + "px"
    this.setData({
      Height: swiperH//设置高度
    })
  },
  
  bindchange: function (e) {
    console.log(e.detail.current)
    this.setData({ current: e.detail.current })
  },

  onLoad(e) {
    console.log(e.title)
    this.setData({
      msgList: 
      [
          { url: "url", title: "   公告：大门口湿地公园已于3月10日限量开放游客游玩"},
          { url: "url", title: "   公告：垃圾分类在线小程序于公测期间评测有奖有料" },
          { url: "url", title: "   公告：分类互动课程游戏在线报名火热开启中" },
          { url: "url", title: "   不管发生什么要加油啊，因为我是钻石💎" }
      ]
    });
  }
})
